package com.ict.ms.controller;

import com.ict.ms.area.facade.api.ICountAllService;
import com.ict.ms.common.StateMsg;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * Created by Administrator on 2017/5/25.
 */
@Controller
@RequestMapping("/count")
public class CountAllDataController {
    @Resource
    ICountAllService service;

    @ResponseBody
    @RequestMapping(value = "countAll.do", method = RequestMethod.POST)
    public String getCount(ModelMap map, @RequestParam("mode") int mode) {
        map.addAttribute("count",service.getCount(mode));
        return StateMsg.toJson(1,map);
    }
}
